package org.jpro.common.jpa;

import static javax.persistence.criteria.Predicate.BooleanOperator.AND;
import static javax.persistence.criteria.Predicate.BooleanOperator.OR;

/**
 * <P>功能描述 : </P>
 * <P>Method Name : Specifications </P>
 * <P>Author : 王泽浩 </P>
 * <P>E-Mail : 1028625100@qq.com </P>
 * <P>Date : 2017-03-14 15:42:16</P>
 * @since 1.0
 */
public class Specifications {

    /**
     * <P>功能描述 : </P>
     * <P>Method Name : and </P>
     * <P>Author : 王泽浩 </P>
     * <P>E-Mail : 1028625100@qq.com </P>
     * <P>Date : 2017-03-14 15:42:16</P>
     * @param <T> the type parameter
     * @return the predicate builder
     * @since 1.0
     */
    public static <T> PredicateBuilder<T> and() {
        return new PredicateBuilder(AND);
    }

    /**
     * <P>功能描述 : </P>
     * <P>Method Name : or </P>
     * <P>Author : 王泽浩 </P>
     * <P>E-Mail : 1028625100@qq.com </P>
     * <P>Date : 2017-03-14 15:42:16</P>
     * @param <T> the type parameter
     * @return the predicate builder
     * @since 1.0
     */
    public static <T> PredicateBuilder<T> or() {
        return new PredicateBuilder(OR);
    }

}
